﻿using Models;
using MySqlSugar;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;

namespace Services.IService
{
   public interface IReplyService
    {
        #region 查询

        /// <summary>
        /// 查询单条根据主键
        /// </summary>
        ReplyModel GetById(int? id);

        /// <summary>
        /// 查询所有
        /// </summary>
        List<ReplyModel> GetList();

        /// <summary>
        /// 根据条件查询
        /// </summary>
        List<ReplyModel> GetList(Expression<Func<ReplyModel, bool>> where);

        /// <summary>
        /// 按页查询
        /// </summary>
        List<ReplyModel> GetPageList(Expression<Func<ReplyModel, bool>> where, int pageIndex, int pageSize, string OrderFields);
        #endregion

        #region 删除
        /// <summary>
        /// 根据主键删除
        /// </summary>
        bool DeleteById(int id);

        /// <summary>
        /// 根据主键组批量删除
        /// </summary>
        bool DeleteById(int[] ids);

        /// <summary>
        /// 根据实体删除【一定要带主键！！！】
        /// </summary>
        bool DeleteByModel(ReplyModel model);

        #endregion

        #region 新增
        /// <summary>
        /// 强制新增，不管主键
        /// </summary>
        int Insert(ReplyModel model);

        /// <summary>
        /// 批量插入 适合海量数据插入
        /// </summary>
        bool InsertRange(List<ReplyModel> list);

        #endregion

        #region 修改
        /// <summary>
        /// 根据实体更新【主键一定要有！！！】
        /// </summary>
        bool Update(ReplyModel model);

        /// <summary>
        /// 10条以上批量更新
        /// </summary>
        bool UpdateRange(List<ReplyModel> list);
        #endregion
    }
}
